From: Aleksey Kladov Date: Mon, 26 Feb 2018 18:39:25 +0000 (+0300) Subject: Support --exclude option for `cargo doc` X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~2^2~77^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=9816c95d99efd49d212382fed2e8a81e1b8d7c6b;p=cargo.git Support --exclude option for `cargo doc` I think this should have been implemented when the feature was added for other commands. Probably just an oversight. --- diff --git a/src/bin/doc.rs b/src/bin/doc.rs index 6e1783696..c0ffcdded 100644 --- a/src/bin/doc.rs +++ b/src/bin/doc.rs @@ -27,6 +27,7 @@ pub struct Options { flag_frozen: bool, flag_locked: bool, flag_all: bool, + flag_exclude: Vec, #[serde(rename = "flag_Z")] flag_z: Vec, } @@ -42,6 +43,7 @@ Options: --open Opens the docs in a browser after the operation -p SPEC, --package SPEC ... Package to document --all Document all packages in the workspace + --exclude SPEC ... Exclude packages from the build --no-deps Don't build documentation for dependencies -j N, --jobs N Number of parallel jobs, defaults to # of CPUs --lib Document only this package's library @@ -88,11 +90,9 @@ pub fn execute(options: Options, config: &mut Config) -> CliResult { let root = find_root_manifest_for_wd(options.flag_manifest_path, config.cwd())?; let ws = Workspace::new(&root, config)?; - let spec = if options.flag_all || (ws.is_virtual() && options.flag_package.is_empty()) { - Packages::All - } else { - Packages::Packages(&options.flag_package) - }; + let spec = Packages::from_flags(options.flag_all, + &options.flag_exclude, + &options.flag_package)?; let empty = Vec::new(); let doc_opts = ops::DocOptions {